package com.penghk.springbootdemo.mq.direct;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Sender2 {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    private int i = 0;

    public void send() {
        i++;
        String context = "sender2 : hello " + i;
        this.rabbitTemplate.convertAndSend("hello", context);
    }

}
